package com.sd.dao.impl;
import com.sd.dao.ImCollectDAO;
import com.sd.domain.ImCollect;
import com.sd.mapper.ImCollectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
 * 收藏功能DAO接口实现
 * @author yexinming
 * @date 2020/7/28
 **/
@Repository
public class ImCollectDAOImpl implements ImCollectDAO {
    /**
     * mapper组件
     */
    @Autowired
    private ImCollectMapper mapper;

    @Override
    public List<ImCollect> listByAgentId(String agentId) {
        return mapper.listByAgentId(agentId);
    }

    @Override
    public Long save(ImCollect collect) {
       mapper.save(collect);
       return collect.getId();
    }

    @Override
    public ImCollect getById(Long id) {
        return mapper.getById(id);
    }
}
